//
//  AboutUsVC.m
//  Meum
//
//  Created by 黄卫 on 17/2/28.
//  Copyright © 2017年 huangwei. All rights reserved.
//

#import "AboutUsVC.h"

@interface AboutUsVC ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)UIView *headerView;
@end

@implementation AboutUsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.tableView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(UITableView *)tableView{
    if (!_tableView) {
        _tableView = [UITableView plainTableView];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.tableHeaderView = self.headerView;
        
    }
    return _tableView;
}

-(UIView *)headerView{
    if (!_headerView) {
        _headerView= [[UIView alloc] init];
        _headerView.frame = CGRectMake(0, 0, Screen_Width, 150);
        UIImageView *img = [[UIImageView alloc] init];
        img.frame = CGRectMake((Screen_Width-60)/2, (150-60)/2, 60, 60);
        [img setImage:[UIImage imageNamed:@"icon_home1"]];
        [_headerView addSubview:img];
        
        UILabel *label = [[UILabel alloc] init];
        label.frame = CGRectMake((Screen_Width-80)/2, CGRectGetMaxY(img.frame)+15, 80, 20);
        label.backgroundColor = [UIColor redColor];
        [_headerView addSubview:label];
        return _headerView;
    }
    return _headerView;
}


#pragma mark UITableViewDelegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    if (indexPath.row==0) {
        cell.textLabel.text = @"版本更新";
        cell.detailTextLabel.text = @"已是最新版";
    }else if(indexPath.row==1){
        cell.textLabel.text = @"用户协议";
    }else{
        cell.textLabel.text = @"公司介绍";
    }
    return cell;
}




@end
